var fs = require('fs');
let shuzu=[]
let max=0;
let min=1000;
let maxFile=0;
let minFile=0;
for(let i=1;i<=100;i++){
    var a= Math.round(Math.random()*1000)
    fs.writeFileSync("./"+i+".txt",""+a+"")
    shuzu[i]=(fs.readFileSync("./"+i+".txt").toString());

    if(Number(shuzu[i])>max){
        max=Number(shuzu[i]);
        maxFile=i;
    }

    if(Number(shuzu[i])<min){
        min=Number(shuzu[i]);
        minFile=i;
    }
}
console.log("有最大值的文件:"+maxFile+".txt,"+max);
console.log("有最小值的文件:"+minFile+".txt,"+min);
    

